package com.su.lession01;
//测试IP

import java.net.InetAddress;
import java.net.UnknownHostException;

public class TestlnetAddress {

    public static void main(String[] args) throws UnknownHostException {
       try{
          InetAddress inetAddress = InetAddress.getByName("127.0.0.1");

           InetAddress inetAddress1= InetAddress.getByName("www.baidu.com");

            System.out.println(inetAddress);
           System.out.println(inetAddress1);

       }catch(UnknownHostException e){
           e.printStackTrace();
       }
    }
}
